package com.ruoyi.caiwu.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.caiwu.mapper.AccountingSubjectsMapper;
import com.ruoyi.caiwu.domain.AccountingSubjects;
import com.ruoyi.caiwu.service.IAccountingSubjectsService;

/**
 * 科目Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-25
 */
@Service
public class AccountingSubjectsServiceImpl implements IAccountingSubjectsService
{
    @Autowired
    private AccountingSubjectsMapper accountingSubjectsMapper;

    /**
     * 查询科目
     *
     * @param subjectId 科目主键
     * @return 科目
     */
    @Override
    public AccountingSubjects selectAccountingSubjectsBySubjectId(Long subjectId)
    {
        return accountingSubjectsMapper.selectAccountingSubjectsBySubjectId(subjectId);
    }

    /**
     * 查询科目列表
     *
     * @param accountingSubjects 科目
     * @return 科目
     */
    @Override
    public List<AccountingSubjects> selectAccountingSubjectsList(AccountingSubjects accountingSubjects)
    {
        return accountingSubjectsMapper.selectAccountingSubjectsList(accountingSubjects);
    }

    /**
     * 新增科目
     *
     * @param accountingSubjects 科目
     * @return 结果
     */
    @Override
    public int insertAccountingSubjects(AccountingSubjects accountingSubjects)
    {
        return accountingSubjectsMapper.insertAccountingSubjects(accountingSubjects);
    }

    /**
     * 修改科目
     *
     * @param accountingSubjects 科目
     * @return 结果
     */
    @Override
    public int updateAccountingSubjects(AccountingSubjects accountingSubjects)
    {
        return accountingSubjectsMapper.updateAccountingSubjects(accountingSubjects);
    }

    /**
     * 批量删除科目
     *
     * @param subjectIds 需要删除的科目主键
     * @return 结果
     */
    @Override
    public int deleteAccountingSubjectsBySubjectIds(Long[] subjectIds)
    {
        return accountingSubjectsMapper.deleteAccountingSubjectsBySubjectIds(subjectIds);
    }

    /**
     * 删除科目信息
     *
     * @param subjectId 科目主键
     * @return 结果
     */
    @Override
    public int deleteAccountingSubjectsBySubjectId(Long subjectId)
    {
        return accountingSubjectsMapper.deleteAccountingSubjectsBySubjectId(subjectId);
    }
}
